package jwdt.xadmin.added.service.impl;


import jwdt.common.dao.BaseDao;
import jwdt.xadmin.added.bean.TVote;
import jwdt.xadmin.added.service.VoteManageService;

import com.ezerg.db.ext.PageUtil;
public class VoteManageServiceImpl implements VoteManageService{
	private BaseDao<TVote> baseDao;
	
	public void setBaseDao(BaseDao<TVote> baseDao) {
		this.baseDao = baseDao;
	}
	@Override
	public PageUtil doList(PageUtil pu) throws Exception{
		String sql = " order by id asc";
		pu.doList(TVote.class,sql);
		//创造json数据对象
		return pu;
	}
	@Override
	public String doAddact(TVote obj) throws Exception {
		return baseDao.doAddObj(obj);
	}

	@Override
	public String doEditact(TVote obj, int id) throws Exception {
		return baseDao.doUpdateObj(TVote.class, id, obj);
	};
	
	@Override
	public String doDelact(int id) throws Exception {
		return baseDao.doDelObj(TVote.class, id);
	}

	@Override
	public TVote doLoad(int id) throws Exception {
		return baseDao.doLoadObj(TVote.class, id);
	}
	@Override
	public String doUpdateState(int id, String result) throws Exception {
		return baseDao.doIntUpdateState(TVote.class, "id="+id, result);
	}
}
